// 获取校区信息
import { ProcessType } from '../types/dapao-process'
import request from '../utils/request'
interface SearchType {
    [key: string]: string | {}
}
// 新增考试步骤
export const ProcessPost = (obj: ProcessType) => {
    return request.post('classes/process', obj)
}


// 新增考试步骤
export const ProcessUpdate = (id:string,obj: ProcessType) => {
    return request.put('classes/process/'+id, obj)
}
// 获取考试步骤
export const ProcessGet = (search = {} as SearchType) => {
    for (let i in search) {
        if (search[i] == '') {
            delete search[i];
        }
    }
    if (search.subject) {
        search.subject = { "$regex": `${search.subject}`, "$options": "i" }
    }
    return request.get('classes/process', {
        params: {
            where: search
        }
    })
}